package de.revdev.llt.module.utility;

import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Produces;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;

/**
 *
 * @author f.lindermaier
 */
public class RequestProducer {

    private FacesContext fc;

    @Produces
    @RequestScoped
    public HttpServletRequest getRequest() {
        return (HttpServletRequest) fc.getExternalContext().getRequest();
    }

    @Inject
    public void setFacesContext(FacesContext facesContext) {
        this.fc = facesContext;
    }
}
